package com.bwton.msx.ccb.service.api;


import com.bwton.msx.ccb.service.api.annotations.EncryptParams;
import com.bwton.msx.ccb.service.api.annotations.TokenRequired;
import com.bwton.msx.ccb.service.api.response.ApiResponse;
import com.bwton.msx.ccb.service.api.response.FaceQueryResult;
import com.bwton.msx.ccb.service.api.response.IgnoreResult;
import com.bwton.msx.ccb.service.api.response.LoginResult;
import com.bwton.msx.ccb.service.api.response.RegisterResult;
import com.bwton.msx.ccb.service.api.response.SignChannelQueryResult;
import com.bwton.msx.ccb.service.api.response.SmsTokenResult;
import com.bwton.msx.ccb.service.api.response.UserInfoResult;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.POST;

public interface AuthApiService {

    /**
     * 发送用户注册验证码
     *
     * @return
     */
    @POST("/bmp-dev-cc01/bas/mc/v1/send-sms-code")
    Observable<ApiResponse<IgnoreResult>> sendRegisterSms(@Body Map<String, String> params);

    /**
     * sms转token
     *
     * @return
     */
    @TokenRequired
    @POST("/bmp-dev-cc01/bas/mc/v1/check-sms-code")
    Observable<ApiResponse<SmsTokenResult>> smsToken(@Body Map<String, String> params);

    /**
     * 设置密码
     *
     * @return
     */
    @TokenRequired
    @EncryptParams(keys = {"new_password"})
    @POST("/bmp-dev-cc01/trip/user/v1/modify-password")
    Observable<ApiResponse<IgnoreResult>> setPassword(@Body Map<String, String> params);

    /**
     * 注册
     *
     * @return
     */
    @POST("/bmp-dev-cc01/trip/user/v1/user-third-register")
    Observable<ApiResponse<RegisterResult>> register(@Body Map<String, String> params);

    /**
     * 验证码登录
     *
     * @return
     */
    @POST("/bmp-dev-cc01/trip/user/v1/login-by-sms-code")
    Observable<ApiResponse<LoginResult>> loginBySms(@Body Map<String, String> params);
    /**
     * 密码登录
     *
     * @return
     */
    @EncryptParams(keys = {"password"})
    @POST("/bmp-dev-cc01/trip/user/v1/login-by-password")
    Observable<ApiResponse<LoginResult>> loginByPassword(@Body Map<String, String> params);
    /**
     * 发送签约（绑卡）短信
     *
     * @param params
     * @return
     */
    @TokenRequired
    @EncryptParams(keys = {"name", "cert_no", "bank_card_no", "mobile_phone"})
    @POST("/bmp-dev-cc01/trip/user/v1/sms-send")
    Observable<ApiResponse<IgnoreResult>> sendSignSms(@Body Map<String, String> params);

    /**
     * 签约 name不要加密
     *
     * @param params
     * @return
     */
    @TokenRequired
    @EncryptParams(keys = {"cert_no", "bank_card_no", "mobile_phone"})
    @POST("/bmp-dev-cc01/trip/user/v1/sign")
    Observable<ApiResponse<Object>> signByCard(@Body Map<String, String> params);

    /**
     * 人脸开通
     *
     * @param params
     * @return
     */
    @TokenRequired
    @POST("/bmp-dev-cc01/trip/order/v1/face/open")
    Observable<ApiResponse<IgnoreResult>> faceOpen(@Body Map<String, String> params);

    /**
     * 人脸管理
     *
     * @param params
     * @return
     */
    @TokenRequired
    @POST("/bmp-dev-cc01/trip/order/v1/face/operate")
    Observable<ApiResponse<IgnoreResult>> faceOperate(@Body Map<String, String> params);

    /**
     * 注册乘车码开通服务
     *
     * @param params
     * @return
     */
    @TokenRequired
    @POST("/bmp-dev-cc01/trip/user/v1/qrCode/register")
    Observable<ApiResponse<IgnoreResult>> registerCode(@Body Map<String, String> params);

    /**
     * 人脸状态查询
     *
     * @return
     */
    @TokenRequired
    @POST("/bmp-dev-cc01/trip/order/v1/face/query")
    Observable<ApiResponse<FaceQueryResult>> queryFace(@Body Map<String, String> params);

    /**
     * 基本信息查询：
     *
     * @return
     */
    @TokenRequired
    @POST("/bmp-dev-cc01/trip/user/v1/user-info-get")
    Observable<ApiResponse<UserInfoResult>> queryInfo(@Body Map<String, String> params);

    /**
     * 签约状态查询
     *
     * @param params
     * @return
     */
    @TokenRequired
    @POST("/bmp-dev-cc01/trip/user/v1/get-sign-result")
    Observable<ApiResponse<SignChannelQueryResult>> querySignResult(@Body Map<String, String> params);

    @TokenRequired
    @POST("/bmp-dev-cc01/trip/user/v1/unSign")
    Observable<ApiResponse<IgnoreResult>> unSign(@Body Map<String, String> params);

    @TokenRequired
    @POST("/bmp-dev-cc01/trip/user/v1/user-cancel")
    Observable<ApiResponse<IgnoreResult>> closeUser(@Body Map<String, String> params);
}
